#include <iostream>
using namespace std;

int main()
{
    const double eps = 1e-5;
    double e = 1;
    double factorial = 1;
    int num = 1;

    do
    {
        factorial /= num++;
        e += factorial;
    }
    while(factorial > eps);

    cout << "e=" << e << endl;
    return 0;
}
